#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int divisorSubstrings(int num, int k)
    {
        int count = 0;
        string s = to_string(num);
        if (s.size() < k) return count;
        int left = 0, right = k - 1;
        while (right < s.size())
        {
            string tmp = s.substr(left, right - left + 1);
            int x = stoi(tmp);
            if (x != 0 && num % x == 0)
            {
                ++count;
            }
            ++left;
            ++right;
        }
        return count;
    }
};